Re: [SQL] string containing (')

Поиск
Список
Период
Сортировка
От Herouth Maoz
Тема Re: [SQL] string containing (')
Дата
Msg-id l03110703b31be8bf8484@[147.233.148.111]
обсуждение исходный текст
Ответ на Re: [SQL] string containing (')  (Brian Baquiran <brianb@evoserve.com>)
Список pgsql-sql
At 18:06 +0200 on 20/03/1999, Brian Baquiran wrote:


> >
> > > HI!
> > > Can anyone help,
> > > I want to store a string into a relation that might contain an apostrophe
> > > (').  Is there anyway around this or can I not store such strings.
> > > Thanks for your help
> >
> > '\''
>
> I've always thought the proper way was to use 2 quotes ('').

It is the proper way, as far as compatibility to standard SQL is concerned.
Both methods are supported by PostgreSQL, though.

I have a certain grievance against PostgreSQL and its escaping mechanism,
which makes scripts written in standard SQL produce wrong results if they
have backslashes in them.

Perhaps there should be a switch, SET COMPATIBILITY or something, which
disables incompatible parses from taking place, and allows using legacy
script with little concern for the content of the strings.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



В списке pgsql-sql по дате отправления:

Предыдущее
От: Peter Garner
Дата:
Сообщение: Re: [SQL] string containing (')
Следующее
От: secret
Дата:
Сообщение: Simple Optimization Problem